package {
	import flash.display.Sprite;
	import flash.events.Event;

	/**
	 * @author JCGray
	 * @version1.0.0
	 * @date May 5, 2011
	 * @client Tuesday Creative
	 * @project Giggle Go
	 * @langversion ActionScript3.0
	 */
	public class LensShitTest extends Sprite 
	{
		
		private var _lenseShiftScene:LensShiftScene;
		private var _shadowBox:ShadowBox;
		private var _faceDetector:FaceDetector_Camera;
		public var count:Number = 0;
		
		public function LensShitTest():void{
			trace("LenseShiftTest called");
			
			_lenseShiftScene = new LensShiftScene();
			_lenseShiftScene.x = 300;
			_lenseShiftScene.y = 300;
			
			this.addChild(_lenseShiftScene);
			
			//_faceDetector = new FaceDetector_Camera();
			//this.addChild(_faceDetector);
			/*
			_shadowBox = new ShadowBox();
			
			var circle:ShadowSprite = new ShadowSprite();
			var square:ShadowSprite = new ShadowSprite();
			var rect:ShadowSprite = new ShadowSprite();
			var tr:ShadowSprite = new ShadowSprite();
			var tl:ShadowSprite = new ShadowSprite();
			var ll:ShadowSprite = new ShadowSprite();
			var lr:ShadowSprite = new ShadowSprite();
			
			with (circle){
				graphics.beginFill(0x990000);
				graphics.drawCircle(-100, -100, 100);
				rX = -200;
				rY = 300;
				rZ = 0;
			}
			
			with (square){
				graphics.beginFill(0x009900);
				graphics.drawRect(-100, -200, 200, 200);
				rX = 200;
				rY = 300;
				rZ = 150;
			}
			
			with (rect){
				graphics.beginFill(0x000099);
				graphics.drawRect(-100, -200, 200, 200);
				rX = 0;
				rY = 300;
				rZ =300;
			}
			
			with (tl){
				rX = -300;
				rY = -300;
				rZ = 600;
			}	
			
			with (tr){
				rX = 300;
				rY = -300;
				rZ =600;
			}
			
			with (ll){
				rX = -300;
				rY = 300;
				rZ =600;
			}
			
			with (lr){
				rX = 300;
				rY = 300;
				rZ =600;
			}			
			
			_shadowBox.addShadowSprite(tl);
			_shadowBox.addShadowSprite(tr);
			_shadowBox.addShadowSprite(lr);
			_shadowBox.addShadowSprite(ll);
			
			
			_shadowBox.addShadowSprite(rect);
			_shadowBox.addShadowSprite(square);
			_shadowBox.addShadowSprite(circle);
			

			
			_shadowBox.x = 300;
			_shadowBox.y = 300;
			this.addChild(_shadowBox);
			 * 
			 */
			
			this.addEventListener(Event.ENTER_FRAME, onEnterFrame)
		}
		
		private function onEnterFrame(e:Event):void
		{
			
			_lenseShiftScene.updateAngle(this.mouseX - 300, this.mouseY - 300, 15);
			//_lenseShiftScene.updateAngle(this.mouseX, this.mouseY - (stage.height * .5), 15);
			//_shadowBox.updateAngles(this.mouseX - 300) ;
			//count ++;
			
		}
		
		
	}
	
}
